/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import expression.*;
import org.junit.*;
import static org.junit.Assert.*;

/**
 *
 * @author David
 */
public class DavidRosenPETest {

    @Test
	public void test1(){
		//3+4*5/6
		int answer = PostfixEvaluator.eval("3 4 5 * 7 / +");
		
		assertTrue(answer == 5);
	}
	
	@Test
	public void test2() {
		
                int answer = PostfixEvaluator.eval("10 10 * 50  2 * - 7 +");
		assertTrue(answer == 7);
	}
	@Test
	public void test3() {
		//(55+33)*(44-22)/(89-100)
		int answer = PostfixEvaluator.eval("55 33 + 44 22 - * 89 100 - /");
		assertTrue(answer == -176);
	}
	
	@Test 
	public void test4(){
		//(9+4)^2 + (5+6)^3
		
		int answer = PostfixEvaluator.eval("9 9 + 2 ^ 5 6 + 3 ^ +");
		assertTrue(answer == 1655);
		
	}
	@Test 
	public void test5(){
		//(6+89)/(55-36) * 10^2
		
		int answer = PostfixEvaluator.eval("6 89 + 55 36 - / 10 2 ^ *");
		
		assertTrue(answer == 500);
		
	}

        @Test 
	public void test6(){
		//1+2*3^4/5/6
		
		long answer = PostfixEvaluator.eval("1 2 3 4 ^ * 5 / 6 / +");
		assertTrue(answer == 6);
	}
}
